<style>
    .ui.fluid.dropdown {
        width: 424px;
    }
    
    .ui.multiple.search.dropdown>.text {
        margin: .2em;
        padding: .25em;
    }
    
    em .ui.selection.dropdown.multiple {
        padding: .22620476em 2.1em .22620476em .35714286em;
    }
    
    .ui.multiple.search.dropdown>input.search {
        margin: 0;
    }
    
    .ui.multiple.dropdown>.label {
        padding: .3em;
    }
    
    .search_btn {
        border-radius: 16px;
        padding: 0 28px;
        height: 32px;
        line-height: 30px;
        background: #39A0ED;
        color: white;
        display: inline-block;
        border: none;
        margin-right: 16px;
        outline: none;
    }
    
    .clear_btn {
        border-radius: 16px;
        padding: 0 28px;
        height: 32px;
        line-height: 30px;
        background: #39A0ED;
        color: white;
        display: inline-block;
        border: none;
        margin-right: 14px;
        outline: none;
    }
    
    .search_btn:hover,
    .clear_btn:hover {
        background: #078ef2
    }
    
    .points div {
        height: 28px;
        line-height: 26px;
        padding: 0 1em;
        border: 1px solid #e2e2e2;
        background: #f2f2f2;
        border-radius: 15px;
        margin-right: 1em;
        margin-top: 10px;
    }
    
    .mybackground .ui.tabular.menu {
        border-bottom: 1px solid #D4D4D5;
    }
</style>
<div class="cont">
    <!--页面遮罩层-->
    <!--二级标题-->
    <div class="position">
        <img alt="位置图标" src="dist/images/position.png" />企业号&gt;订户管理
        <a ng-click="openDetail()" ng-hide="$needClientCache" title="打开新窗口查看"><i class="large External icon"></i>
    </div>
    <!--查看方式-->

    <div class="mybackground">
        <div class="ui top attached tabular menu">
        <a class="{{firstactive}}" ng-click="OrderCustomerDataList(1)" data-tab="first" id="firsttab">客户</a>
        <a class="{{secondactive}}" ng-click="OrderCustomerDataList(10)" data-tab="second" id="secondtab">员工</a>
        <a class="{{thirdactive}}" ng-click="OrderCustomerDataList(20)" data-tab="third" id="thirdtab">外部访客</a>
    </div>
    <div class="{{firstsegment}}" data-tab="first" id="firsttabsegement" style="padding: 5px 14px 0">
        <div class="menus">
            <div class="menus_con ui form" ng-keyup="$event.keyCode == 13 && OrderCustomerDataList(1)">
                <div class="four fields">
                    <div class="inline field">
                        <label>客户编号/姓名</label>
                        <input type="text" ng-model="firstparam.customer" placeholder="客户编号/姓名" maxlength="15" style="width: 160px;padding: 0.5em">
                    </div>
                    <div class="inline field">
                        <label style="margin-right: 2em">是否开通</label>
                        <select ng-model="firstparam.is_open" class="ui dropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{op.k}}" ng-repeat="op in open">{{op.v}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>是否关注</label>
                        <select ng-model="firstparam.is_order" class="ui dropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{or.k}}" ng-repeat="or in order">{{or.v}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>是否禁用</label>
                        <select ng-model="firstparam.is_forbidden" class="ui dropdown">   
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{fd.k}}" ng-repeat="fd in forbidden">{{fd.v}}</option>
                                </select>
                    </div>
                </div>
                <div class="four fields">
                    <div class="inline field">
                        <label style="margin-right: 3.3em">归属套餐</label>
                        <select ng-model="firstparam.package" class="ui dropdown" id="firstpackagedropdown">
                                <!--ng-options="firstpck.package_code as firstpck.name for firstpck in packagesearch">-->
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{firstpck.package_code}}" ng-repeat="firstpck in packagesearch">{{firstpck.name}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>归属企业号</label>
                        <select ng-model="firstparam.subscribe" class="ui dropdown" id="firstdropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{firstacc.qy_code}}" ng-repeat="firstacc in companyaccountsearch">{{firstacc.qy_name}}</option>
                                </select>
                    </div>
                </div>
                <div class=" fields">
                    <div class="inline field">
                        <button class="search_btn" ng-click="OrderCustomerDataList(1)" style="margin-left: 7.2em;"> 查询</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="{{secondsegment}}" data-tab="second" id="secondtabsegment" style="padding: 5px 14px 0">
        <div class="cont_fr_btn" style="text-align: right">
            <button class="clear_btn" ng-click="adduser()">添加</button>
        </div>
        <div class="menus">
            <div class="menus_con ui form" ng-keyup="$event.keyCode == 13 && OrderCustomerDataList(10)">
                <div class="four fields">
                    <div class="inline field">
                        <label>员工编号/姓名</label>
                        <input type="text" ng-model="secondparam.customer" placeholder="客户编号/姓名" maxlength="15" style="width: 160px;padding: 0.5em">
                    </div>
                    <div class="inline field">
                        <label style="margin-right: 2em">是否开通</label>
                        <select ng-model="secondparam.is_open" class="ui dropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{op.k}}" ng-repeat="op in open">{{op.v}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>是否关注</label>
                        <select ng-model="secondparam.is_order" class="ui dropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{or.k}}" ng-repeat="or in order">{{or.v}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>是否禁用</label>
                        <select ng-model="secondparam.is_forbidden" class="ui dropdown">   
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{fd.k}}" ng-repeat="fd in forbidden">{{fd.v}}</option>
                                </select>
                    </div>

                </div>
                <div class="four fields">
                    <div class="inline field">
                        <label style="margin-right: 3.3em">归属套餐</label>
                        <select ng-model="secondparam.package" class="ui dropdown" id="secondpackagedropdown">
                                 <!--ng-options="pck.package_code as pck.name for pck in packagesearch">-->
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{pck.package_code}}" ng-repeat = "pck in packagesearch">{{pck.name}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>归属企业号</label>
                        <select ng-model="secondparam.subscribe" class="ui dropdown" id="seconddropdown">
                            <!--ng-options="acc.qy_code as acc.qy_name for acc in companyaccountsearch" id="seconddropdown">-->
                                        <option value="" selected disabled hidden>处理状态</option>
                                        <option value="{{acc.qy_code}}" ng-repeat="acc in companyaccountsearch">{{acc.qy_name}}</option>
                                </select>
                    </div>
                </div>
                <div class=" fields">
                    <div class="inline field">
                        <button class="search_btn" ng-click="OrderCustomerDataList(10)" style="margin-left: 7.2em;"> 查询</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="{{thirdsegment}}" data-tab="third" id="thirdtabsegment" style="padding: 5px 14px 0">
        <div class="cont_fr_btn" style="text-align: right">
            <button class="clear_btn" ng-click="addstranger()">添加</button>
        </div>
        <div class="menus">
            <div class="menus_con ui form" ng-keyup="$event.keyCode == 13 && OrderCustomerDataList(20)">
                <div class="four fields">
                    <div class="inline field">
                        <label>访客编号/姓名</label>
                        <input type="text" ng-model="thirdparam.customer" placeholder="客户编号/姓名" maxlength="15" style="width: 160px; padding: 0.5em">
                    </div>
                    <div class="inline field">
                        <label style="margin-right: 2em">是否开通</label>
                        <select ng-model="thirdparam.is_open" class="ui dropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{op.k}}" ng-repeat="op in open">{{op.v}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>是否关注</label>
                        <select ng-model="thirdparam.is_order" class="ui dropdown">
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{or.k}}" ng-repeat="or in order">{{or.v}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>是否禁用</label>
                        <select ng-model="thirdparam.is_forbidden" class="ui dropdown" ng-options="fd.k as fd.v for fd in forbidden">   
                                        <option value="" selected disabled hidden>全部</option>
                                        <option value="{{fd.k}}" ng-repeat="fd in forbidden">{{fd.v}}</option>
                                </select>
                    </div>
                </div>
                <div class="four fields">
                    <div class="inline field">
                        <label style="margin-right: 3.3em">归属套餐</label>
                        <select ng-model="thirdparam.package" class="ui dropdown" id="thirdpackagedropdown">
                                <!--ng-options="thirdpck.package_code as thirdpck.name for thirdpck in packagesearch">-->
                                        <option value="" selected disabled hidden>处理状态</option>
                                        <option value="{{thirdpck.package_code}}" ng-repeat="thirdpck in packagesearch">{{thirdpck.name}}</option>
                                </select>
                    </div>
                    <div class="inline field">
                        <label>归属企业号</label>
                        <select ng-model="thirdparam.subscribe" class="ui dropdown" id="thirddropdown">
                                        <option value="" selected disabled hidden>处理状态</option>
                                        <option value="{{thirdacc.qy_code}}" ng-repeat="thirdacc in companyaccountsearch">{{thirdacc.qy_name}}</option>
                                </select>
                    </div>
                </div>
                <div class=" fields">
                    <div class="inline field">
                        <button class="search_btn" ng-click="OrderCustomerDataList(20)" style="margin-left: 7.2em;"> 查询</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--</div>-->
    <div class="menus_table">
        <table class="ui yellow celled striped table">
            <thead>
                <tr ng-if="type == 1">
                    <th>客户编号</th>
                    <th>客户姓名</th>
                    <th>微信号</th>
                    <th>手机号</th>
                    <!--<th>服务状态</th>-->
                    <th>是否开通</th>
                    <th>是否关注</th>
                    <th>是否禁用</th>
                    <th style="text-align: center">操作</th>
                </tr>
                <tr ng-if="type == 10">
                    <th>员工编号</th>
                    <th>员工姓名</th>
                    <th>微信号</th>
                    <th>手机号</th>
                    <!--<th>服务状态</th>-->
                    <th>是否开通</th>
                    <th>是否关注</th>
                    <th>是否禁用</th>
                    <th style="text-align: center">操作</th>
                </tr>
                <tr ng-if="type == 20">
                    <th>访客编号</th>
                    <th>访客姓名</th>
                    <th>微信号</th>
                    <th>手机号</th>
                    <!--<th>服务状态</th>-->
                    <th>是否开通</th>
                    <th>是否关注</th>
                    <th>是否禁用</th>
                    <th style="text-align: center">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="(k,v) in qysource">
                    <!--<td ng-if="type == 1 || type == 10">{{v.qy_subscriber_userid}}</td>-->
                    <!--<td ng-if="type == 20">{{k+1}}</td>-->
                    <td>{{v.qy_subscriber_userid}}</td>
                    <!--20170714 wjw添加客户浮窗开始-->
                    <td ng-if="v.qy_subscriber_type != 1">{{v.qy_subscriber_name}}</td>
                    <td ng-if="v.qy_subscriber_type == 1">
                        <div float_layer customer-id='v.customer_id' show-name="v.qy_subscriber_name"></div>
                    </td>
                    <!--添加浮窗结束-->
                    <td>{{v.qy_subscriber_weixinid}}</td>
                    <td>{{v.qy_subscriber_mobile}}</td>
                    <td ng-if="v.qy_subscriber_sync == 1">是</td>
                    <td ng-if="v.qy_subscriber_sync == 0">否</td>
                    <td ng-if="v.qy_subscriber_guanzhu == 1">是</td>
                    <td ng-if="v.qy_subscriber_guanzhu == 0">否</td>
                    <td ng-if="v.qy_subscriber_enable == 1">否</td>
                    <td ng-if="v.qy_subscriber_enable == 0">是</td>
                    <td style="text-align: center">
                        <a href="javascript:;" ng-if="v.qy_subscriber_type == 1" ng-click="qycustomermodify(v.qy_subscriber_id)">修改</a>
                        <a href="javascript:;" ng-if="v.qy_subscriber_type == 10" ng-click="qymodify(v.qy_subscriber_id)">修改</a>
                        <a href="javascript:;" ng-if="v.qy_subscriber_type == 20" ng-click="qystrangermodify(v.qy_subscriber_id)">修改</a>
                        <a href="javascript:;" ng-if="v.qy_subscriber_enable == 1" ng-click="qyforbidden(v.qy_subscriber_id,stratorend.end,1,v.qy_subscriber_name)">禁用</a>
                        <a href="javascript:;" ng-if="v.qy_subscriber_enable == 0" ng-click="qyforbidden(v.qy_subscriber_id,stratorend.start,2,v.qy_subscriber_name)">启用</a>
                        <a href="javascript:;" ng-if="type != 1" ng-click="qydelete(v.qy_subscriber_id,v.qy_subscriber_name)">删除</a>
                    </td>
                </tr>
            </tbody>
            <tr>
                <td colspan="8" ng-show="qysourcepage.pageAll == 0">
                    <p class="null_data">没有找到数据~~~</p>
                </td>

            </tr>
        </table>
        <div class="ui pagination menu fr " ng-show="qysourcepage.pageAll > 1" class="ui borderless pagination menu" jspagination page-object="qysourcepage" page-func="pagedisplay"></div>
    </div>
</div>

<!--delete qy records-->
<div class="ui modal modal3 " id="subscriber_del">
    <div class="header_h4 " style="text-align: center; ">删除投诉记录</div>
    <div class="content " style="text-align: center; ">
        <i class="huge blue help circle icon "></i>
        <p style="padding-top: 15px; "></p>
    </div>
    <div class="actions " style="text-align: center; ">
        <div class="ui positive button ">确定</div>
        <button class="ui grey button negative ">取消</button>
    </div>
</div>

<!--forbidden qy records-->
<div class="ui modal forbidden " id="subscriber_forbidden">
    <div class="header_h4 " style="text-align: center; ">禁用订户</div>
    <div class="content " style="text-align: center; ">
        <i class="huge blue help circle icon "></i>
        <p style="padding-top: 15px; "></p>
    </div>
    <div class="actions " style="text-align: center; ">
        <div class="ui positive button ">确定</div>
        <button class="ui grey button negative ">取消</button>
    </div>
</div>

<!--display repeating user-->
<div class="ui modal modal4 " id="subscriber_repeat">
    <div class="header_h4 " style="text-align: center; ">提示</div>
    <div class="content " style="text-align: center; ">
        <i class="huge blue help circle icon "></i>
        <p style="padding-top: 15px; "></p>
    </div>
    <div class="actions " style="text-align: center; ">
        <button class="ui grey button negative ">取消</button>
    </div>
</div>
<!--display repeating user-->

<!--add success-->
<div class="ui modal modal1" style="text-align: center;">
    <div class="header center aligned">提示</div>
    <div class="content center aligned">
        <i class="huge green check circle outline icon"></i>
        <p style="padding-top: 15px;">添加成功</p>
    </div>
</div>
<!--add success-->
<div class="ui modal modal2" style="text-align: center;">
    <div class="header center aligned">提示</div>
    <div class="content center aligned">
        <i class="huge red remove circle outline icon"></i>
        <p style="padding-top: 15px;">添加失败</p>
    </div>
</div>
<!--编辑成功-->
<div class="ui small modal editOk" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge green check circle outline icon"></i>
        <p style="padding-top: 15px;">编辑成功</p>
    </div>
</div>
<!--编辑失败-->
<div class="ui modal editFail" style="text-align: center;">
    <div class="header">提示</div>
    <div class="content">
        <i class="huge red warning outline icon"></i>
        <p style="padding-top: 15px;">编辑失败</p>
    </div>
</div>
<!-- add form is beginning -->
<div class="ui add modal">
    <i class="close icon"></i>
    <div class="header_h4">
        添加员工
    </div>
    <div class="content">
        <div class="ui form">
            <form name="adduserform" id="adduserform">
                <div class="field">
                    <input type="hidden" id="hideInput">
                </div>
                <div class="subhead">选择员工</div>
                <div class="clearfix">
                    <div class="fields ">
                        <div class="inline field required">
                            <label>所属部门</label>
                            <select ng-model="addsecondparam.sector" class="ui dropdown" ng-options="sub.sector_id as sub.rep + sub.sector_name for sub in editcallsubcompany|tree2Arr:'_child'" id="subcompany" name="secondsubcompany">
                            <option value="" selected disabled hidden>所属分公司</option>
                        </select>
                        </div>
                    </div>
                    <div class="ui segment clearfix" ng-if="addsecondparam.sector">
                        <div style="max-height: 200px; overflow: auto; width: 230px; float:left; margin-right:20px">
                            <div class="clearfix">
                                <span class="sector_checkbox font13"><b>员工姓名</b></span>
                            </div>
                            <div class="clearfix">
                                <div style="line-height: 1.6em; color: #333; display: inline-block" class="fl" ng-if="addsecondparam.sector">全部</div>
                                <div class="ui checkbox" style="float: right">
                                    <input type="checkbox" name="checkedall" value="" ng-click="checkall()" ng-checked="checkedall">
                                    <label></label>
                                </div>
                            </div>

                            <div ng-repeat="(k,v) in userpackage" class="clearfix">
                                <div style="line-height: 1.6em; color: #333; display: inline-block" class="fl">{{v.nickname}}</div>
                                <div class="ui checkbox fr">
                                    <input type="checkbox" name="add[]" value="{{v.login_name}}" ng-click="addusermsg(k)">
                                    <label></label>
                                </div>
                            </div>
                        </div>
                        <div class="fl" style="width: calc(100% - 250px)">
                            <div class="fl" style="width: 100%;">
                                <div><b>选定人员:</b></div>
                                <div class="ui segment points clearfix" style="min-height: 160px;">
                                    <div ng-repeat="r in addsecondparam.add track by $index" class="fl point">{{r}}</div>
                                </div>
                            </div>
                        </div>
                        <div class="field">
                            <div id="adddiv" style="min-height: 0px;">
                            </div>
                        </div>
                    </div>

                </div>

                <div class="subhead" style="margin-top: 8px">选择套餐</div>
                <div class="fields">
                    <div class="inline field required">
                        <label style="margin-right: 1.9em">企业号</label>
                        <select ng-model="addsecondparam.companyaccount" class="ui dropdown" ng-options="addacc.qy_code as addacc.qy_name for addacc in companyaccount" name="addmultipleaccount">
                                    <option value="" selected disabled hidden>所属企业号</option>
                            </select>
                    </div>
                </div>
                <div class="fields">
                    <div class="inline field required">
                        <label style="margin-right: 2.9em">套餐</label>
                        <div class="ui input">
                            <select class="ui fluid search dropdown" multiple="" ng-model="addsecondparam.addpck" name="addmultiple" id="addmultipleaddpck"> 
                                    <option value="" selected disabled hidden>所属套餐</option>
                                    <option value="{{addpck.qy_deparment_id}}" ng-repeat="addpck in package">{{addpck.name}}</option>
                                </select>
                        </div>
                    </div>
                </div>
                <div class="subhead">服务时间</div>
                <div class="three fields">
                    <div class="field">
                        <label style="margin-right: 1.6em" class="label_fl">开始时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="addsecondparam.stime" placeholder="开始时间" datetimepicker="" format="YYYY-MM-DD" id="secondstartTime" name="secondstartTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                    <div class="field">
                        <label class="label_fl">结束时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="addsecondparam.etime" placeholder="结束时间" datetimepicker="" format="YYYY-MM-DD" id="secondendTime" name="secondendTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="actions">
        <div class="ui green button positive" id="sure">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>

<!--modify subscriber-->
<div class="ui modify modal">
    <i class="close icon"></i>
    <div class="header_h4">
        员工信息修改
    </div>
    <div class="content">
        <div class="ui form">
            <form name="edituserform" id="edituserform">
                <input type="hidden" id="userid">
                <div class="three fields">
                    <div class="inline field">
                        <label style="margin-right: 1.8em">员工姓名</label>
                        <span ng-model="editsecondparam.qy_subscriber_name" placeholder="员工姓名" maxlength="15" style="width: 160px" name="username">{{editsecondparam.qy_subscriber_name}}</span>
                    </div>
                    <div class="field required">
                        <label class="label_fl">微信号</label>
                        <input type="text" ng-model="editsecondparam.qy_subscriber_weixinid" placeholder="微信号" maxlength="15" style="width:160px;height: 32px" name="usereditwechat">
                    </div>
                    <div class="field required">
                        <label class="label_fl">手机号</label>
                        <input type="text" ng-model="editsecondparam.qy_subscriber_mobile" placeholder="手机号" maxlength="15" style="width: 160px" name="usereditphone">
                    </div>
                </div>
                <div class="inline field required">
                    <label style="margin-right: 1.1em">归属套餐</label>
                    <!--<select ng-model="editsecondparam.subscribe" class="ui dropdown" ng-options="acc.qy_code as acc.qy_name for acc in companyaccount">
                                    <option value="" selected disabled hidden>处理状态</option>
                            </select>-->
                    <div class="ui input">
                        <select class="ui fluid search dropdown" multiple="" ng-model="editsecondparam.subscribe" id="editmultiple" name="editmultipledropdown">
                                <!--ng-options="editpck.package_code as editpck.name for editpck in package">-->
                                <option value="" selected disabled hidden>全部</option>
                                <option value="{{editpck.qy_deparment_id}}" ng-repeat="editpck in addpackage">{{editpck.name}}</option>
                            </select>
                    </div>
                </div>
                <div class="inline field">
                    <div class="inline field">
                        <label>归属企业号</label>
                        <span ng-model="editsecondparam.qy_code" placeholder="归属企业号" maxlength="15" style="width: 160px" id="usercompanyaccount" name="userqyaccount">{{editsecondparam.qy_code}}</span>
                    </div>
                </div>
                <div class="three fields">
                    <div class="field">
                        <label style="margin-right: 1.8em" class="label_fl">开始时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="editsecondparam.start_time" placeholder="开始时间" datetimepicker="" format="YYYY-MM-DD" id="editfirstTime" name="editfirstTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>

                    <div class="field">
                        <label class="label_fl">结束时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="editsecondparam.end_time" placeholder="结束时间" datetimepicker="" format="YYYY-MM-DD" id="editsecondTime" name="editsecondTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="actions">
        <div class="ui green button positive" id="sure">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>

<!--stranger add is beginning-->
<div class="ui addstranger modal">
    <i class="close icon"></i>
    <div class="header_h4">
        添加访客
    </div>
    <div class="content">
        <div class="ui form">
            <form name="addstrangerform" id="addstrangerform">
                <div class="subhead">访客信息</div>
                <div class="three fields">
                    <div class="field required">
                        <label style="margin-right: 1.2em" class="label_fl">姓名</label>
                        <input type="text" ng-model="thirdparam.customername" placeholder="客户编号/姓名" maxlength="15" style="width: 160px" name="strangername">
                    </div>
                    <div class="field required">
                        <label class="label_fl">微信号</label>
                        <input type="text" ng-model="thirdparam.wechat" placeholder="微信号" maxlength="15" style="width: 160px" name="strangewechat">
                    </div>
                    <div class="field required">
                        <label class="label_fl">手机号</label>
                        <input type="text" ng-model="thirdparam.phone" placeholder="手机号" maxlength="15" style="width: 160px" name="strangephone">
                    </div>
                </div>
                <div class="subhead">选择套餐</div>
                <div class="fields">
                    <div class="inline field required">
                        <label style="margin-right: 0.8em">企业号</label>
                        <select ng-model="thirdparam.companyaccount" class="ui dropdown" name="strangermultipledropdown" id="strangermultipledropdown">
                                    <option value="" selected disabled hidden>所属企业号</option>
                                    <option value="{{addacc.qy_code}}" ng-repeat="addacc in companyaccount">{{addacc.qy_name}}</option>
                            </select>
                    </div>
                </div>
                <div class="fields">
                    <div class="inline field required">
                        <label style="margin-right: 1.8em">套餐</label>
                        <!--<select ng-model="addsecondparam.package" class="ui dropdown" ng-options="">
                                    <option value="" selected disabled hidden>全部</option>
                            </select>-->
                        <div class="ui input">
                            <select class="ui fluid search dropdown" multiple="" ng-model="thirdparam.addpck" ng-options="addpck.qy_deparment_id as addpck.name for addpck in thirdpackage" name="strangermultiple" id="thirdmultiple">
                            <option value="" selected disabled hidden>所属套餐</option>
                        </select>
                        </div>

                    </div>
                </div>

                <div class="subhead">服务时间</div>
                <div class="three fields">
                    <div class="field">
                        <label class="label_fl">开始时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="thirdparam.stime" placeholder="开始时间" datetimepicker="" format="YYYY-MM-DD" id="thirdstartTime" name="thirdstartTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                    <div class="field">
                        <label class="label_fl">结束时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="thirdparam.etime" placeholder="结束时间" datetimepicker="" format="YYYY-MM-DD" id="thirdendTime" name="thirdendTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="actions">
        <div class="ui green button positive" id="sure">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>
<!--stranger add is the end-->

<!--modify stranger-->
<div class="ui thirdmodify modal">
    <i class="close icon"></i>
    <div class="header_h4">
        访客信息修改
    </div>
    <div class="content">
        <div class="ui form">
            <form name="editstrangerform" id="editstrangerform">
                <input type="hidden" id="strangerid">
                <input type="hidden" id="str_companyaccount">
                <div class="three fields">
                    <div class="field required">
                        <label style="margin-right: 0.4em" class="label_fl">访客姓名</label>
                        <input type="text" ng-model="editthirdparam.qy_subscriber_name" placeholder="访客姓名" maxlength="15" name="editstrangername" style="width: 160px">
                    </div>
                    <div class="field required">
                        <label class="label_fl">微信号</label>
                        <input type="text" ng-model="editthirdparam.qy_subscriber_weixinid" placeholder="微信号" maxlength="15" name="editstrangerwechat" style="width:160px;height: 32px">
                    </div>
                    <div class="field required">
                        <label class="label_fl">手机号</label>
                        <input type="text" ng-model="editthirdparam.qy_subscriber_mobile" placeholder="微信号" maxlength="15" name="editstrangerphone" style="width: 160px">
                    </div>
                </div>
                <!--<div class="fields">-->
                <div class="inline field required">
                    <label style="margin-right: 1.1em">归属套餐</label>
                    <div class="ui input">
                        <select class="ui fluid search dropdown" multiple="" ng-model="editthirdparam.subscribe" id="editthirdmultiple" name="editthirdmultipledropdown">
                                <option value="" selected disabled hidden>全部</option>
                                <option value="{{editthirdpck.qy_deparment_id}}" ng-repeat="editthirdpck in addthirdpackage">{{editthirdpck.name}}</option>
                            </select>
                    </div>
                </div>
                <!--</div>-->
                <div class="inline field">
                    <div class="inline field">
                        <label>归属企业号</label>
                        <span ng-model="editthirdparam.qy_code" placeholder="归属企业号" maxlength="15" style="width: 160px" id="strangerqycode">{{editthirdparam.qy_code}}</span>
                    </div>
                </div>
                <div class="three fields">
                    <div class="field">
                        <label style="margin-right: 1.8em" class="label_fl">开始时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="editthirdparam.start_time" placeholder="开始时间" datetimepicker="" format="YYYY-MM-DD" id="editstartTime" name="editstartTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                    <div class="field">
                        <label class="label_fl">结束时间</label>
                        <div class="ui left icon input" style="width:160px;height: 32px">
                            <input ng-model="editthirdparam.end_time" placeholder="结束时间" datetimepicker="" format="YYYY-MM-DD" id="editendTime" name="editendTime" style="width:160px;height: 32px">
                            <i class="calendar icon"></i>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="actions">
        <div class="ui green button positive" id="sure">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>
<!--modify stranger-->

<!--modify customer is the beginning-->
<div class="ui firstmodify modal">
    <i class="close icon"></i>
    <div class="header_h4">
        客户信息修改
    </div>
    <div class="content">
        <div class="ui form">
            <form name="editcustomerform" id="editcustomerform">
                <input type="hidden" id="subscriberid">
                <input type="hidden" id="subscriber_companyaccount">
                <div class="three fields">
                    <div class="inline field">
                        <label style="margin-right: 1.8em">访客姓名</label>
                        <span ng-model="editfirstparam.qy_subscriber_name" placeholder="员工姓名" maxlength="15">{{editfirstparam.qy_subscriber_name}}</span>
                    </div>
                    <div class="field required">
                        <label class="label_fl">微信号</label>
                        <input type="text" ng-model="editfirstparam.qy_subscriber_weixinid" placeholder="微信号" maxlength="15" name="editwechat" style="width:160px;height: 32px">
                    </div>
                    <div class="field required">
                        <label class="label_fl">手机号</label>
                        <input type="text" ng-model="editfirstparam.qy_subscriber_mobile" placeholder="手机号" maxlength="15" name="editphone" style="width:160px;height: 32px">
                    </div>
                </div>
                <div class="inline field">
                    <label style="margin-right: 1.1em">归属套餐</label>
                    <div class="ui input">
                        <div>
                            <span ng-repeat="editfirstpck in editfirstparam.pro">{{editfirstpck.packagename}}({{editfirstpck.name}})</span>
                        </div>
                    </div>

                </div>
                <div class="inline field">
                    <div class="inline field">
                        <label>归属企业号</label>
                        <span ng-model="editfirstparam.qy_code" placeholder="归属企业号" maxlength="15" style="width: 160px" id="cst_companyaccount">{{editfirstparam.qy_code}}</span>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="actions">
        <div class="ui green button positive">确定</div>
        <button class="ui grey button negative">取消</button>
    </div>
</div>
<!--modify costomer is the end-->
<script type="text/javascript">
    $(function() {
        $('.ui.dropdown').dropdown();
        $("#editmultiple").dropdown({
            allowLabels: true
        });

        // user add verify
        $.fn.form.settings.rules.sutimeverify = function() {
            var isValid = false;
            if (!$('#secondstartTime').val() && $('#secondendTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        //user add verify
        $.fn.form.settings.rules.eutimeverify = function() {
            var isValid = false;
            if ($('#secondstartTime').val() && !$('#secondendTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        // user edit verify
        $.fn.form.settings.rules.seutimeverify = function() {
            var isValid = false;
            if (!$('#editfirstTime').val() && $('#editsecondTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        //user edit verify
        $.fn.form.settings.rules.eeutimeverify = function() {
            var isValid = false;
            if ($('#editfirstTime').val() && !$('#editsecondTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        // stranger add verify
        $.fn.form.settings.rules.stimeverify = function() {
            var isValid = false;
            if (!$('#thirdstartTime').val() && $('#thirdendTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        //stranger add verify
        $.fn.form.settings.rules.etimeverify = function() {
            var isValid = false;
            if ($('#thirdstartTime').val() && !$('#thirdendTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        // stranger edit verify
        $.fn.form.settings.rules.sedittimeverify = function() {
            var isValid = false;
            if (!$('#editstartTime').val() && $('#editendTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        //stranger edit verify
        $.fn.form.settings.rules.eedittimeverify = function() {
            var isValid = false;
            if ($('#editstartTime').val() && !$('#editendTime').val()) {
                return isValid;
            } else {
                isValid = true;
                return isValid;
            }
        }

        // avoide  wechat msg duplicate
        $.fn.form.settings.rules.wechat_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var companyaccount = $("#strangermultipledropdown").val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/wechat_duplicate",
                data: {
                    data: value,
                    companyaccount: companyaccount
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        //avoid phone msg duplicate
        $.fn.form.settings.rules.phone_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var companyaccount = $("#strangermultipledropdown").val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/phone_duplicate",
                data: {
                    data: value,
                    companyaccount: companyaccount
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        // avoide to edit wechat msg duplicate
        $.fn.form.settings.rules.edit_stranger_wechat_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var strangerid = $('#strangerid').val();
            var qycode = $('#strangerqycode').val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/edit_wechat_duplicate",
                data: {
                    data: value,
                    id: strangerid,
                    qy_code: qycode
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        // avoide to edit phone msg duplicate
        $.fn.form.settings.rules.edit_stranger_phone_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var strangerid = $('#strangerid').val();
            var qycode = $('#strangerqycode').val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/edit_phone_duplicate",
                data: {
                    data: value,
                    id: strangerid,
                    qy_code: qycode
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        // avoide to edit wechat msg duplicate
        $.fn.form.settings.rules.edit_user_wechat_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var userid = $('#userid').val();
            var companyaccount = $('#usercompanyaccount').val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/edit_wechat_duplicate",
                data: {
                    data: value,
                    id: userid,
                    qy_code: companyaccount
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        // avoide to edit phone msg duplicate
        $.fn.form.settings.rules.edit_user_phone_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var userid = $('#userid').val();
            var companyaccount = $('#usercompanyaccount').val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/edit_phone_duplicate",
                data: {
                    data: value,
                    id: userid,
                    qy_code: companyaccount
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        // avoide to edit wechat msg duplicate
        $.fn.form.settings.rules.edit_customer_wechat_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var subscirberid = $('#subscriberid').val();
            var account = $('#cst_companyaccount').val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/edit_wechat_duplicate",
                data: {
                    data: value,
                    id: subscirberid,
                    qy_code: account
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }

        // avoide to edit phone msg duplicate
        $.fn.form.settings.rules.edit_customer_phone_duplicate = function() {
            var isValid = false;
            var value = this[0].value;
            var subscirberid = $('#subscriberid').val();
            var account = $('#cst_companyaccount').val();
            $.ajax({
                method: "POST",
                url: "/Admin/OrderCustomer/edit_phone_duplicate",
                data: {
                    data: value,
                    id: subscirberid,
                    qy_code: account
                },
                success: function(msg) {
                    if (msg == 'true') {
                        isValid = true;
                    }
                },
                async: false
            });
            return isValid;
        }


        $('#adduserform').form({
            inline: true,
            on: 'blur',
            fields: {
                addmultiple: {
                    identifier: 'addmultiple',
                    rules: [{
                        type: 'empty',
                        prompt: '用户套餐不能为空'
                    }]
                },
                addmultipleaccount: {
                    identifier: 'addmultipleaccount',
                    rules: [{
                        type: 'empty',
                        prompt: '企业号不能为空'
                    }]
                },
                secondsubcompany: {
                    identifier: 'secondsubcompany',
                    rules: [{
                        type: 'empty',
                        prompt: '归属部门不能为空',
                    }]
                },
                add: {
                    identifier: 'add',
                    rules: [{
                        type: 'empty',
                        prompt: '选定人员不能为空',
                    }]
                },
                secondstartTime: {
                    identifier: 'secondstartTime',
                    rules: [{
                        type: 'sutimeverify',
                        prompt: '服务开始时间不能为空',
                    }]
                },
                secondendTime: {
                    identifier: 'secondendTime',
                    rules: [{
                        type: 'eutimeverify',
                        prompt: '服务结束时间不能为空',
                    }]
                }
            }
        });

        $('#edituserform').form({
            inline: true,
            on: 'blur',
            fields: {
                editmultipledropdown: {
                    identifier: 'editmultipledropdown',
                    rules: [{
                        type: 'empty',
                        prompt: '用户套餐不能为空'
                    }]
                },
                usereditwechat: {
                    identifier: 'usereditwechat',
                    rules: [{
                        type: 'empty',
                        prompt: '微信号码不能为空'
                    }, {
                        type: 'edit_user_wechat_duplicate',
                        prompt: '微信号码重复'
                    }]
                },
                usereditphone: {
                    identifier: 'usereditphone',
                    rules: [{
                        type: 'empty',
                        prompt: '手机号码不能为空'
                    }, {
                        type: 'edit_user_phone_duplicate',
                        prompt: '手机号码重复'
                    }]
                },
                editfirstTime: {
                    identifier: 'editfirstTime',
                    rules: [{
                        type: 'seutimeverify',
                        prompt: '服务开始时间不能为空'
                    }]
                },
                editsecondTime: {
                    identifier: 'editsecondTime',
                    rules: [{
                        type: 'eeutimeverify',
                        prompt: '服务结束时间不能为空'
                    }]
                }
            }
        });

        $('#addstrangerform').form({
            inline: true,
            on: 'blur',
            fields: {
                strangername: {
                    identifier: 'strangername',
                    rules: [{
                        type: 'empty',
                        prompt: '访客姓名不能为空'
                    }]
                },
                strangewechat: {
                    identifier: 'strangewechat',
                    rules: [{
                        type: 'empty',
                        prompt: '微信号码不能为空'
                    }, {
                        type: 'wechat_duplicate',
                        prompt: '微信号码重复'
                    }]
                },
                strangephone: {
                    identifier: 'strangephone',
                    rules: [{
                        type: 'empty',
                        prompt: '手机号不能为空'
                    }, {
                        type: 'phone_duplicate',
                        prompt: '手机号码重复'
                    }]
                },
                strangermultipledropdown: {
                    identifier: 'strangermultipledropdown',
                    rules: [{
                        type: 'empty',
                        prompt: '归属企业号不能为空'
                    }]
                },
                strangermultiple: {
                    identifier: 'strangermultiple',
                    rules: [{
                        type: 'empty',
                        prompt: '产品套餐不能为空'
                    }]
                },
                thirdstartTime: {
                    identifier: 'thirdstartTime',
                    rules: [{
                        type: 'stimeverify',
                        prompt: '服务开始时间不能为空'
                    }]
                },
                thirdendTime: {
                    identifier: 'thirdendTime',
                    rules: [{
                        type: 'etimeverify',
                        prompt: '服务结束时间不能为空'
                    }]
                },
            }
        });

        $('#editstrangerform').form({
            inline: true,
            on: 'blur',
            fields: {
                editstrangername: {
                    identifier: 'editstrangername',
                    rules: [{
                        type: 'empty',
                        prompt: '访客姓名不能为空'
                    }]
                },
                editstrangerwechat: {
                    identifier: 'editstrangerwechat',
                    rules: [{
                        type: 'empty',
                        prompt: '微信号码不能为空'
                    }, {
                        type: 'edit_stranger_wechat_duplicate',
                        prompt: '微信号码重复'
                    }]
                },
                editstrangerphone: {
                    identifier: 'editstrangerphone',
                    rules: [{
                        type: 'empty',
                        prompt: '访客手机号码不能为空'
                    }, {
                        type: 'edit_stranger_phone_duplicate',
                        prompt: '手机号码重复'
                    }]
                },
                editthirdmultipledropdown: {
                    identifier: 'editthirdmultipledropdown',
                    rules: [{
                        type: 'empty',
                        prompt: '归属套餐不能为空'
                    }]
                },
                editstartTime: {
                    identifier: 'editstartTime',
                    rules: [{
                        type: 'sedittimeverify',
                        prompt: '服务开始时间不能为空'
                    }]
                },
                editendTime: {
                    identifier: 'editendTime',
                    rules: [{
                        type: 'eedittimeverify',
                        prompt: '服务结束时间不能为空'
                    }]
                }
            }
        })

        $('#editcustomerform').form({
            inline: true,
            on: 'blur',
            fields: {
                editwechat: {
                    identifier: 'editwechat',
                    rules: [{
                        type: 'empty',
                        prompt: '微信号码不能为空'
                    }, {
                        type: 'edit_customer_wechat_duplicate',
                        prompt: '微信号码重复'
                    }]
                },
                editphone: {
                    identifier: 'editphone',
                    rules: [{
                        type: 'empty',
                        prompt: '手机号码不能为空',
                    }, {
                        type: 'edit_customer_phone_duplicate',
                        prompt: '手机号码重复'
                    }]
                }
            }
        })
    });
</script>
<!-- 表单结束 -->